

import {useEffect,useState} from "react"

export default function MyHoc(Com){
    
    return function Mhov(){
        let [x,setX] = useState(()=>{
            return "hahah"
        })
        let [y,setY] = useState(()=>{
            return "hahahYYYYYYYY"
        })
        useEffect(()=>{
            window.addEventListener("mousemove",(e)=>{
                setX(e.clientX)
                setY(e.clientY)
            })
        },[x,y])
        return (<Com x = {x} y = {y}></Com>)
    }
}